package com.winshare.saleAssistant.mapper;

import com.winshare.saleAssistant.domain.entity.ProductDO;
import com.winshare.saleAssistant.domain.query.ProductPreviewQuery;
import com.winshare.saleAssistant.domain.query.ProductQuery;
import com.winshare.saleAssistant.domain.dto.req.*;
import com.winshare.saleAssistant.domain.dto.resp.ProductPreviewDTO;
import com.winshare.saleAssistant.domain.dto.resp.ProductRespDTO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ProductMapStruct {

    ProductMapStruct INSTANCE = Mappers.getMapper(ProductMapStruct.class);

    ProductDO fromProductCreateDTO(ProductCreateDTO productCreateDTO);

    ProductDO fromProductUpdateDTO(ProductUpdateDTO productUpdateDTO);

    ProductDO fromProductIdDTO(ProductIdDTO productIdDTO);

    ProductQuery fromProductQueryDTO(ProductQueryDTO productQueryDTO);

    ProductRespDTO fromProductDO(ProductDO productDO);

    List<ProductRespDTO> fromProductDOList(List<ProductDO> productDOList);

    ProductPreviewDTO fromProductDOToProductPreviewDTO(ProductDO productDOInSql);

    ProductDO fromProductSortDTO(ProductSortDTO productSortDTO);

    ProductPreviewQuery fromProductPreviewQueryDTO(ProductPreviewQueryDTO productPreviewQueryDTO);

    ProductDO fromProductPreviewQuery(ProductPreviewQuery productPreviewQuery);

    ProductDO fromBaseIdDTO(BaseIdDTO baseIdDTO);

    ProductDO fromProductReadCountDTO(ProductReadCountDTO productReadCountDTO);
}
